///<reference path='./libs/platform/Extensions.ts'/>
require( './libs/platform/Extensions' );

import utils = module('./libs/PlatformUtility');
import Storage = module('./libs/storage/RedisDataAccess');
import ObjectModel = module('./libs/ObjectModel');
import Catalog = module('./sample/Catalog');

utils.trace('Starting...');
// import redis = module('redis');
// utils.trace('Redis Loaded');

utils.trace('Criando Produto...');
var prod = new Catalog.Product();

//utils.inspect(prod);
//utils.trace(prod.fields[0].name);
//utils.trace('Produto criado: ' + prod.schema.getQualifiedName().getFullName());

var engine = new ObjectModel.DocumentEngine(new Storage.RedisStorage());
debugger;
Catalog.registerSchemas(engine);
engine.save(new Catalog.Product());

var a = [2, 3, 5];
utils.trace( a.firstOrDefault() );